home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / sharew / dfue / midi.net / anetmidi / midithrs / mtru.s < prev    next >
Encoding:
Text File  |  1990-10-03  |  1.4 KB  |  63 lines

  1.  
  2. midisend    equ    $FFFFFC06
  3. midiread    equ    $FFFFFC06
  4. midictrl    equ    $FFFFFC04
  5. midistat    equ    $FFFFFC04
  6. mfpiis        equ    $FFFFFA11 ; bit 6... for midi-acia...
  7. bit6        equ    $40
  8. notbit6        equ    $BF
  9.  
  10.  
  11. main:
  12.     bra.b    instal
  13.     dc.b    "MTRU"             ; more or less dbra protocol...
  14.     dc.b    "DBRA"
  15.  
  16. interrupt:
  17.     btst    #3,midistat     ; check midi out status
  18.     bne.b    notready
  19.     move.b    d0,midisend     ; if ready, send character on
  20. notready:
  21.     andi.b    #notbit6,mfpiis ; disable interrupt-in-service bit in mfp
  22.     rts
  23.  
  24. instal:
  25.     move.w    #$0022,-(a7)    ; Kbdvbase
  26.     trap    #14                ; Xbios
  27.     addq.l    #2,a7
  28.     movea.l    d0,a0            ;
  29.     move.l    (a0),a1
  30.     cmpi.l    #"MTRU",-8(a1)    ; already installed?
  31.     beq.b   present            ; then leave 
  32.     move.l    (a0),oldvec
  33.     move.l    #interrupt,(a0) ; replace midi routine by our own interrupt
  34.     bra.b    show
  35.  
  36. present:
  37.     pea     text2            ; message: already present
  38.     move.w    #$9,-(a7)
  39.     trap    #1
  40.     addq.l    #6,a7
  41.     move.w    #0,-(a7)     
  42.     move.w    #$4c,-(a7)        ; pterm
  43.     trap    #1              ; do not install
  44.  
  45. show:
  46.     pea        text             ; greet the people
  47.     move.w    #$9,-(a7)
  48.     trap    #1
  49.     addq.l    #6,a7
  50.     move.w    #0,d0
  51.     move.l    #386,-(a7)         ; 256(basepage) + 130(for program)
  52.     move.w    #$31,-(a7)        ; terminate & stay resident
  53.     trap    #1
  54.  
  55.     .bss
  56. oldvec:
  57.     ds.l    1
  58.  
  59.     .data    
  60. text:    dc.b    10,13," *** Midi-thru (C) Copyright E. van Herk 1990"
  61.         dc.b    10,13," Midi-thru installed ! ",10,13,0
  62. text2:    dc.b    10,13," *** MIDI-THRU already loaded - aborted ! ",0
  63.